#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int T = 0;
	scanf("%d", &T);
	while (T--)
	{
		int a = 0;
		int b = 0;
		int c = 0;
		int d = 0;
		scanf("%d %d %d %d", &a, &b, &c, &d);
		if (1.0 * a / b > 1.0 * c / d)
		{
			printf("S\n");
		}
		if (1.0 * a / b < 1.0 * c / d)
		{
			printf("Y\n");
		}
	}
	return 0;
}